import axios from '../../network/axios'

// 获取所有季度
export const getQuarterList = (params) => {
  return axios({
    method: 'GET',
    url: '/quarter/quarter',
    params
  })
}

// 按条件获取季度
export const getByConditionQuarterList = (params) => {
  return axios({
    method: 'GET',
    url: '/quarter/list',
    params
  })
}

// 新增季度
export const addQuarter = (quarterName) => {
  return axios({
    method: 'POST',
    url: '/quarter/quarter',
    params: {
      quarterName
    }
  })
}

// 查询默认显示季度
export const getQuarterShow = (params) => {
  return axios({
    method: 'POST',
    url: '/quarter/show',
    params
  })
}

// 季节转换(默认季节)
export const quarterChange = (params) => {
  return axios({
    method: 'POST',
    url: '/quarter/change',
    params
  })
}

// 修改季度的状态
export const updateQuarterStatus = ({ id, inSeason }) => {
  return axios({
    method: 'PUT',
    url: '/quarter/updateObj',
    params: {
      id,
      inSeason
    }
  })
}

// 删除
export const deleteQuarter = (id) => {
  return axios({
    method: 'DELETE',
    url: '/quarter/delete',
    params: {
      id
    }
  })
}
